﻿using CommonUtils;
using System;

namespace ControllerGenerator.Commands
{
    class DbContextGenerator
    {
        public static void Handler(object sender, EventArgs e)
        {
            var path = WindowsUtil.SelectSavePathWithName("Db.cs");
            if (path.IsEmpty())
                return;
            var controllerCode = ResourceUtil.GetText(typeof(DbContextGenerator).Assembly, "Db.txt");
            FileUtil.SaveTo(path, controllerCode);
            EditorUtil.ShowMessage("代码已生成: " + path);
        }
    }
}

